package com.example.service1.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/service1")
public class Service1Controller {

    @Autowired
    Environment environment;

    @GetMapping("/call")
    public String callService1(){
        String port = environment.getProperty("server.port");
        System.out.println("端口：" + port);
        return "service1";
    }
}
